package com.sky.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.OrderSubmitVO;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;


public interface OrderMapper extends BaseMapper<Orders> {

    OrderSubmitVO getByUserIdAndAddressBookId(Orders orders);

    List<Orders> getAllOrderInfoByUserIdAndStatus(Orders orders);

    void setOrderSatatusToCancelByIds(List<Long> ids);

    Orders getOrderInfoById(Long id);

    /**
     * 根据订单号查询订单
     *
     * @param orderNumber
     */
    @Select("select * from sky_take_out.orders where number = #{orderNumber}")
    Orders getByNumber(String orderNumber);


    /**
     * 修改订单信息
     * @param orders
     */
    void update(Orders orders);

    List<Orders> getOrderPageInfo(OrdersPageQueryDTO dto);

    Integer getOrderStatusCount(Integer status);


    List<Orders> getAllByStatusAndTime(Long status, LocalDateTime outTime);

}






